#ifndef EQCTRLMODEL_H
#define EQCTRLMODEL_H

#include <QAbstractTableModel>
#include <QItemSelection>
#include <QDebug>

#include "dm/dmstruct.h"


class EqCtrlModel : public QAbstractTableModel
{
    Q_OBJECT
public:
    explicit EqCtrlModel(QObject *parent = nullptr);
    int rowCount(const QModelIndex &parent = QModelIndex()) const override;
    int columnCount(const QModelIndex &parent = QModelIndex()) const override;
    QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
    bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
    Qt::ItemFlags flags(const QModelIndex &index) const override;
    QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
signals:
    void dataModified(const int &, const EQ &);
public slots:
    void setList(QList<EQ> &list);
    void setEq(const int &index, const EQ &eq);
    void activateEdit(const QModelIndex &index);
private:
    QList<EQ> m_list;
    QStringList m_header;
    int m_row;
};

#endif // EQCTRLMODEL_H
